package com.mtw.bbs.constant;


import java.util.Objects;

/**
 * 评论等级枚举
 */
public enum ReplyTypeEnum {

    ARTICLE_REPLY(1,"bus_article");



    private final Integer code;
    private final String businessObjectType;

    ReplyTypeEnum(Integer code,String businessObjectType){
        this.code = code;
        this.businessObjectType = businessObjectType;
    }



    public Integer getCode(){
        return this.code;
    }

    public String getBusinessObjectType(){
        return this.businessObjectType;
    }


    public static ReplyTypeEnum getEnum(Integer code){
        for(ReplyTypeEnum replyTypeEnum : ReplyTypeEnum.values()){
            if(Objects.equals(replyTypeEnum.getCode(), code)){
                return replyTypeEnum;
            }
        }
        return null;
    }

    public static String getBusinessObjectType(Integer code){
        for(ReplyTypeEnum replyTypeEnum : ReplyTypeEnum.values()){
            if(Objects.equals(replyTypeEnum.getCode(), code)){
                return replyTypeEnum.getBusinessObjectType();
            }
        }
        return null;
    }



}
